package simple_factory_pattern.v3;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入数字A: ");
        String strNumberA = sc.next();
        System.out.print("请选择运算符号（+、-、*、/）: ");
        String strOperate = sc.next();
        System.out.print("请输入数字B: ");
        String strNumberB = sc.next();
        double doubleNumberA = Double.parseDouble(strNumberA);
        double doubleNumberB = Double.parseDouble(strNumberB);
        double res = Operation.getResult(doubleNumberA, doubleNumberB, strOperate);
        System.out.println("结果是: " + res);
    }
}
